package com.xyx.www;

import java.io.EOFException;
import java.io.IOException;

public class TestTryCatch {

	public static void main(String args[]) {
		try {
			ma(1);
			System.out.println("No Exception");
		} catch (EOFException ex1) {
			System.out.println("ex1");
		} catch (IOException ex2) {
			System.out.println("ex2");
		}
	}

	public static void ma(int n) throws NullPointerException,EOFException {
		if (n == 1) {
			throw new NullPointerException();
		} else if (n == 2) {
			throw new EOFException();
		}
	}
}
